/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.ronsicecream.pos.entities;

import com.buanalintas.bynga.entities.MasterUnit;
import com.buanalintas.bynga.entities.MasterUser;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author user
 */
@Entity
@Table(name = "pos_transaction_mk_distribution_to_outlet")
@XmlRootElement
//@NamedQueries({
//    @NamedQuery(name = "PosTransactionMkDistributionToOutlet.findAll", query = "SELECT p FROM PosTransactionMkDistributionToOutlet p"),
//    @NamedQuery(name = "PosTransactionMkDistributionToOutlet.findBySync", query = "SELECT p FROM PosTransactionMkDistributionToOutlet p WHERE p.sync = :sync"),
//    @NamedQuery(name = "PosTransactionMkDistributionToOutlet.findByDistributionId", query = "SELECT p FROM PosTransactionMkDistributionToOutlet p WHERE p.distributionId = :distributionId"),
//    @NamedQuery(name = "PosTransactionMkDistributionToOutlet.findByDistributionDistributorBy", query = "SELECT p FROM PosTransactionMkDistributionToOutlet p WHERE p.distributionDistributorBy = :distributionDistributorBy"),
//    @NamedQuery(name = "PosTransactionMkDistributionToOutlet.findByDistributionNumber", query = "SELECT p FROM PosTransactionMkDistributionToOutlet p WHERE p.distributionNumber = :distributionNumber"),
//    @NamedQuery(name = "PosTransactionMkDistributionToOutlet.findByDistributionCost", query = "SELECT p FROM PosTransactionMkDistributionToOutlet p WHERE p.distributionCost = :distributionCost"),
//    @NamedQuery(name = "PosTransactionMkDistributionToOutlet.findByDistributionTotal", query = "SELECT p FROM PosTransactionMkDistributionToOutlet p WHERE p.distributionTotal = :distributionTotal"),
//    @NamedQuery(name = "PosTransactionMkDistributionToOutlet.findByDistributionQuantity", query = "SELECT p FROM PosTransactionMkDistributionToOutlet p WHERE p.distributionQuantity = :distributionQuantity"),
//    @NamedQuery(name = "PosTransactionMkDistributionToOutlet.findByDistributionPaid", query = "SELECT p FROM PosTransactionMkDistributionToOutlet p WHERE p.distributionPaid = :distributionPaid"),
//    @NamedQuery(name = "PosTransactionMkDistributionToOutlet.findByDistributionUnpaid", query = "SELECT p FROM PosTransactionMkDistributionToOutlet p WHERE p.distributionUnpaid = :distributionUnpaid"),
//    @NamedQuery(name = "PosTransactionMkDistributionToOutlet.findByDistributionSent", query = "SELECT p FROM PosTransactionMkDistributionToOutlet p WHERE p.distributionSent = :distributionSent"),
//    @NamedQuery(name = "PosTransactionMkDistributionToOutlet.findByDistributionUnsent", query = "SELECT p FROM PosTransactionMkDistributionToOutlet p WHERE p.distributionUnsent = :distributionUnsent"),
//    @NamedQuery(name = "PosTransactionMkDistributionToOutlet.findByDistributionKeel", query = "SELECT p FROM PosTransactionMkDistributionToOutlet p WHERE p.distributionKeel = :distributionKeel"),
//    @NamedQuery(name = "PosTransactionMkDistributionToOutlet.findByDistributionDate", query = "SELECT p FROM PosTransactionMkDistributionToOutlet p WHERE p.distributionDate = :distributionDate"),
//    @NamedQuery(name = "PosTransactionMkDistributionToOutlet.findByDistributionProgress", query = "SELECT p FROM PosTransactionMkDistributionToOutlet p WHERE p.distributionProgress = :distributionProgress"),
//    @NamedQuery(name = "PosTransactionMkDistributionToOutlet.findByDistributionRejectReason", query = "SELECT p FROM PosTransactionMkDistributionToOutlet p WHERE p.distributionRejectReason = :distributionRejectReason"),
//    @NamedQuery(name = "PosTransactionMkDistributionToOutlet.findByDistributionTimestamp", query = "SELECT p FROM PosTransactionMkDistributionToOutlet p WHERE p.distributionTimestamp = :distributionTimestamp")})
public class PosTransactionMkDistributionToOutlet implements Serializable {
    private static final long serialVersionUID = 1L;
    @Column(name = "sync")
    private String sync;
    @Id
    @Basic(optional = false)
    @Column(name = "distribution_id")
    private Integer distributionId;
    @Column(name = "distribution_distributor_by")
    private String distributionDistributorBy;
    @Column(name = "distribution_number")
    private String distributionNumber;
    @Column(name = "distribution_cost")
    private BigDecimal distributionCost;
    @Column(name = "distribution_total")
    private BigDecimal distributionTotal;
    @Column(name = "distribution_quantity")
    private BigDecimal distributionQuantity;
    @Column(name = "distribution_paid")
    private BigDecimal distributionPaid;
    @Column(name = "distribution_unpaid")
    private BigDecimal distributionUnpaid;
    @Column(name = "distribution_sent")
    private BigDecimal distributionSent;
    @Column(name = "distribution_unsent")
    private BigDecimal distributionUnsent;
    @Column(name = "distribution_keel")
    private String distributionKeel;
    @Column(name = "distribution_date")
    @Temporal(TemporalType.DATE)
    private Date distributionDate;
    @Column(name = "distribution_progress")
    private String distributionProgress;
    @Column(name = "distribution_reject_reason")
    private String distributionRejectReason;
    @Lob
    @Column(name = "distribution_description")
    private String distributionDescription;
    @Column(name = "distribution_timestamp")
    @Temporal(TemporalType.TIMESTAMP)
    private Date distributionTimestamp;
    @JoinColumn(name = "distribution_work_order_id", referencedColumnName = "work_order_id")
    @ManyToOne
    private PosTransactionMkWorkOrder distributionWorkOrderId;
    @JoinColumn(name = "distribution_user_id", referencedColumnName = "user_id")
    @ManyToOne(optional = false)
    private MasterUser distributionUserId;
    @JoinColumn(name = "distribution_unit_id", referencedColumnName = "unit_id")
    @ManyToOne(optional = false)
    private MasterUnit distributionUnitId;
    @JoinColumn(name = "distribution_regional_id", referencedColumnName = "regional_id")
    @ManyToOne(optional = false)
    private PosMasterRegional distributionRegionalId;
    @JoinColumn(name = "distribution_pos_unit_id", referencedColumnName = "unit_id")
    @ManyToOne(optional = false)
    private PosMasterUnit distributionPosUnitId;
    
    
    public PosTransactionMkDistributionToOutlet() {
    }

    public PosTransactionMkDistributionToOutlet(Integer distributionId) {
        this.distributionId = distributionId;
    }

    public String getSync() {
        return sync;
    }

    public void setSync(String sync) {
        this.sync = sync;
    }

    public Integer getDistributionId() {
        return distributionId;
    }

    public void setDistributionId(Integer distributionId) {
        this.distributionId = distributionId;
    }

    public String getDistributionDistributorBy() {
        return distributionDistributorBy;
    }

    public void setDistributionDistributorBy(String distributionDistributorBy) {
        this.distributionDistributorBy = distributionDistributorBy;
    }

    public String getDistributionNumber() {
        return distributionNumber;
    }

    public void setDistributionNumber(String distributionNumber) {
        this.distributionNumber = distributionNumber;
    }

    public BigDecimal getDistributionCost() {
        return distributionCost;
    }

    public void setDistributionCost(BigDecimal distributionCost) {
        this.distributionCost = distributionCost;
    }

    public BigDecimal getDistributionTotal() {
        return distributionTotal;
    }

    public void setDistributionTotal(BigDecimal distributionTotal) {
        this.distributionTotal = distributionTotal;
    }

    public BigDecimal getDistributionQuantity() {
        return distributionQuantity;
    }

    public void setDistributionQuantity(BigDecimal distributionQuantity) {
        this.distributionQuantity = distributionQuantity;
    }

    public BigDecimal getDistributionPaid() {
        return distributionPaid;
    }

    public void setDistributionPaid(BigDecimal distributionPaid) {
        this.distributionPaid = distributionPaid;
    }

    public BigDecimal getDistributionUnpaid() {
        return distributionUnpaid;
    }

    public void setDistributionUnpaid(BigDecimal distributionUnpaid) {
        this.distributionUnpaid = distributionUnpaid;
    }

    public BigDecimal getDistributionSent() {
        return distributionSent;
    }

    public void setDistributionSent(BigDecimal distributionSent) {
        this.distributionSent = distributionSent;
    }

    public BigDecimal getDistributionUnsent() {
        return distributionUnsent;
    }

    public void setDistributionUnsent(BigDecimal distributionUnsent) {
        this.distributionUnsent = distributionUnsent;
    }

    public String getDistributionKeel() {
        return distributionKeel;
    }

    public void setDistributionKeel(String distributionKeel) {
        this.distributionKeel = distributionKeel;
    }

    public Date getDistributionDate() {
        return distributionDate;
    }

    public void setDistributionDate(Date distributionDate) {
        this.distributionDate = distributionDate;
    }

    public String getDistributionProgress() {
        return distributionProgress;
    }

    public void setDistributionProgress(String distributionProgress) {
        this.distributionProgress = distributionProgress;
    }

    public String getDistributionRejectReason() {
        return distributionRejectReason;
    }

    public void setDistributionRejectReason(String distributionRejectReason) {
        this.distributionRejectReason = distributionRejectReason;
    }

    public String getDistributionDescription() {
        return distributionDescription;
    }

    public void setDistributionDescription(String distributionDescription) {
        this.distributionDescription = distributionDescription;
    }

    public Date getDistributionTimestamp() {
        return distributionTimestamp;
    }

    public void setDistributionTimestamp(Date distributionTimestamp) {
        this.distributionTimestamp = distributionTimestamp;
    }

    public PosTransactionMkWorkOrder getDistributionWorkOrderId() {
        return distributionWorkOrderId;
    }

    public void setDistributionWorkOrderId(PosTransactionMkWorkOrder distributionWorkOrderId) {
        this.distributionWorkOrderId = distributionWorkOrderId;
    }

    public MasterUser getDistributionUserId() {
        return distributionUserId;
    }

    public void setDistributionUserId(MasterUser distributionUserId) {
        this.distributionUserId = distributionUserId;
    }

    public MasterUnit getDistributionUnitId() {
        return distributionUnitId;
    }

    public void setDistributionUnitId(MasterUnit distributionUnitId) {
        this.distributionUnitId = distributionUnitId;
    }

    public PosMasterRegional getDistributionRegionalId() {
        return distributionRegionalId;
    }

    public void setDistributionRegionalId(PosMasterRegional distributionRegionalId) {
        this.distributionRegionalId = distributionRegionalId;
    }

    public PosMasterUnit getDistributionPosUnitId() {
        return distributionPosUnitId;
    }

    public void setDistributionPosUnitId(PosMasterUnit distributionPosUnitId) {
        this.distributionPosUnitId = distributionPosUnitId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (distributionId != null ? distributionId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof PosTransactionMkDistributionToOutlet)) {
            return false;
        }
        PosTransactionMkDistributionToOutlet other = (PosTransactionMkDistributionToOutlet) object;
        if ((this.distributionId == null && other.distributionId != null) || (this.distributionId != null && !this.distributionId.equals(other.distributionId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return  distributionNumber;
//        return "com.ronsicecream.pos.entities.PosTransactionMkDistributionToOutlet[ distributionId=" + distributionId + " ]";
    }
    
}
